object pj3 {
  class run{
    def addOne(list: List[Int]):List[Int]={
      list.map(_ + 1)
    }
    def filterEven(list:List[Int]): Unit ={
      list.filter(_ % 2 == 0)
    }
    def mapReduce(list: List[Int])(mapFunction: Int => Int)(reduceFunction: (Int, Int) => Int): Int = {
      list.map(mapFunction).reduce(reduceFunction)
    }
  }
  def main(args: Array[String]): Unit = {
    val t = new run()
    val list = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    val addOneList = t.addOne(list)
    println(addOneList)
    val filterEvens = t.filterEven(list)
    println(filterEvens)
    val mapReduces = t.mapReduce(list)(x => x * 2)(_ + _)
    println(mapReduces)
  }
}